import java.util.Random;
import java.util.Scanner;

public class Demo05 {
    public static void main(String[] args) {
        int[] arr = new int[10];
        Random ran = new Random();
        for (int i = 0; i < arr.length; i++) {
            arr[i] = ran.nextInt(100);
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + "    ");
        }
        System.out.println("\n==============================");
        System.out.println("请输入要找的数");
        int tofind = new Scanner(System.in).nextInt();
        boolean zdl = false;
        int i;
        for (i = 0; i < arr.length; i++) {
            if (tofind == arr[i]) {
                System.out.println(tofind + "在数组的第" + (i + 1) + "位");
                zdl = true;
            }
        }
        if (!zdl) System.out.println(tofind + "不在数组内");
    }
}
